<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <link rel="stylesheet" th:href="@{/css/bootstrap-5.3.0-alpha1-dist/css/bootstrap.min.css}">
    <script th:src="@{/js/jquery-3.5.1.js}"></script>
    <script th:src="@{/js/bootstrap4.1.3.main.js}"></script>
    <script th:src="@{/js/bootstrap.bundle.js}"></script>
    <link th:href="@{/css/cikauser.css}" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
    <div class="myheader1 row">
        <div class="i col-3" style="display: inline">
            <h5><img class="rounded-circle" src="/picture/0.jpg" style="width: 65px"> </h5>
        </div>
        <div class="t col-7"><h1>停车场管理系统</h1></div>
        <div class="u col-2"><a href="/users/logout"><h4>退出</h4></a></div>
    </div>
    <table class="myheader2">
        <tr>
            <td class="nav-item" style="color: white;background-color: rgb(75, 126, 126);">
                <a class="nav-link" data-src="/users/userinfo">个人信息</a>
            </td>
            <td th:if="${Result.data.usertype eq '次卡'}" class="nav-item">
                <a class="nav-link" data-src="/users/usercheckcount">剩余次数</a>
            </td>
            <td th:if="${Result.data.usertype eq '月卡'}" class="nav-item">
                <a class="nav-link" data-src="/users/usercheckcount">剩余时长</a>
            </td>
            <td class="nav-item">
                <a class="nav-link" data-src="/users/useraddlicenseplate">添加车牌号</a>
            </td>
            <td class="nav-item">
                <a class="nav-link" data-src="/users/usermodifylicense">修改车牌号</a>
            </td>
            <td class="nav-item">
                <a class="nav-link" data-src="/users/userrecharge">充值</a>
            </td>
            <td class="nav-item">
                <a class="nav-link" data-src="/users/userreturn">退费</a>
            </td>
        </tr>
    </table>
    <iframe class="myinformationpage" src="/users/userinfo"></iframe>
</div>
</body>

<script>
    $(function () {
        $(".myheader2 tr .nav-item a").on("click", function () {
            const address = $(this).attr("data-src");
            $("iframe").attr("src", address);
            $(this).parent().css("background-color", "rgb(75, 126, 126)");
            $(this).parent().css("color", "white");
            $(this).parent().siblings().css("background-color", "darkgray");
            $(this).parent().siblings().css("color", "#1b1b1f");
        });
    });
</script>
</html>